package pl.smath.regex.tree;

public class TapePosition implements Comparable<TapePosition> {

	private int first;
	private int second;
	
	public TapePosition(int f, int s) {
		first = f;
		second = s;
	}

	public TapePosition(int f) {
		first = f;
		second = 0;
	}
	
	public String toString() {
		return first + " " + second;
	}

	public boolean notFound() {
		return first < 0 || second < 0;
	}
	
	public void setFirst(int first) {
		this.first = first;
	}
	
	public int getFirst() {
		return first;
	}
	
	public void setSecond(int second) {
		this.second = second;
	}
	
	public int getSecond() {
		return second;
	}

	@Override
	public int compareTo(TapePosition o) {
		if (first != o.getFirst()) return (first - o.getFirst());
		else return (second - o.getSecond());
	}
	
}
